<template>
  <el-descriptions :border="true" :column="3">
    <el-descriptions-item label="编号" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Number }}
    </el-descriptions-item>
    <el-descriptions-item label="方案名称" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Name_Maintain }}
    </el-descriptions-item>
    <el-descriptions-item label="配件费用" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Fittings }}
    </el-descriptions-item>
    <el-descriptions-item label="配件说明" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Fittings_Remark }}
    </el-descriptions-item>
    <el-descriptions-item label="工时损失费" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.WorkHours }}
    </el-descriptions-item>
    <el-descriptions-item label="工时损失说明" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.WorkHours_Remark }}
    </el-descriptions-item>
    <el-descriptions-item label="委外费用" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Outsource }}
    </el-descriptions-item>
    <el-descriptions-item label="委外说明" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Outsource_Remark }}
    </el-descriptions-item>
    <el-descriptions-item label="其他费用" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Other }}
    </el-descriptions-item>
    <el-descriptions-item label="其他说明" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Other_Remark }}
    </el-descriptions-item>
    <el-descriptions-item label="总费用(元)" v-if="Info.ID_MaintainPlan != 0">
      {{ Info.Total }}
    </el-descriptions-item>
    <el-descriptions-item label="备注">
      {{ Info.Remark }}
    </el-descriptions-item>
    <el-descriptions-item label="创建人">
      {{ $filterUserName(Info.CreateUser) }}
    </el-descriptions-item>
    <el-descriptions-item label="创建时间">
      {{ Info.CreateTime }}
    </el-descriptions-item>
    <el-descriptions-item label="保养结果" v-if="Info.ID_MaintainPlan != 0">
      <el-tag
        effect="dark"
        :type="Info.Finish_Result == 1 ? 'success' : 'danger'"
        >{{ Info.Finish_Result == 1 ? '合格' : '不合格' }}</el-tag
      >
    </el-descriptions-item>
    <el-descriptions-item label="检验结果" v-if="Info.ID_MaintainPlan == 0">
      <el-tag
        effect="dark"
        :type="Info.Finish_ResultTools == 1 ? 'success' : 'danger'"
      >
        {{ Info.Finish_ResultTools == 1 ? '合格' : '不合格' }}</el-tag
      >
    </el-descriptions-item>
    <el-descriptions-item label="附件">
      <FileUpload
        :detail="true"
        :showBtn="false"
        v-model:fileList="props.detailData.Files"
      >
      </FileUpload>
    </el-descriptions-item>
  </el-descriptions>
  <el-table
    :border="true"
    :data="Items"
    class="mgt20"
    v-if="Info.ID_MaintainPlan != 0"
  >
    <el-table-column prop="Code" label="编号" width="120" />
    <el-table-column prop="Content" :label="props.PlanName + '项内容'" />
    <el-table-column prop="State" label="是否合格">
      <template v-slot="{ row }">
        <el-tag effect="dark" type="success" v-if="row.State == 1">
          合格
        </el-tag>
        <el-tag effect="dark" type="danger" v-if="row.State == 2">
          不合格
        </el-tag>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
import { computed } from 'vue';
const props = defineProps({
  PlanName: {
    default: ''
  },

  detailData: {
    default: {
      Info: {},
      Items: {}
    }
  }
});

const Info = computed(() => props.detailData.Info);
const Items = computed(() => props.detailData.Items);
</script>

<style lang="scss" scoped></style>
